﻿@model FieldControlViewModel
@{ 
	string ctlID = Model.Prefix + Model.FieldName;
	string dataVal = string.Empty;
	string dataValMsg = string.Empty;
	if (Model.EnableNull)
	{
		dataVal += " data-val-required=\"不能为空\" ";
	}
	if (!string.IsNullOrEmpty(dataVal))
	{
		dataVal += " data-val=\"true\" ";
		dataValMsg = " data-valmsg-for=\""+ Model.Prefix + Model.FieldName + "\" data-valmsg-replace=\"true\"";
	}
}
<span class="select-box radius">
	<span class="layui-col-xs3 layui-col-sm3 layui-col-md3">
		<select lay-ignore class="select" onchange="SelectCategory1('@{@ctlID}')" id="@{@ctlID}Category1" name="@{@ctlID}Category1"></select>
	</span>
	<span class="layui-col-xs3 layui-col-sm3 layui-col-md3">
		<select lay-ignore class="select" onchange="SelectCategory2('@{@ctlID}')" id="@{@ctlID}Category2" name="@{@ctlID}Category2"></select>
	</span>
	<span class="layui-col-xs3 layui-col-sm3 layui-col-md3">
		<select lay-ignore class="select" onchange="SelectCategory3('@{@ctlID}')" id="@{@ctlID}Category3" name="@{@ctlID}Category3"></select>
	</span>
	<span class="layui-col-xs3 layui-col-sm3 layui-col-md3">
		<select lay-ignore class="select" onchange="SelectCategory4('@{@ctlID}')" id="@{@ctlID}Category4" name="@{@ctlID}Category4"></select>
	</span>
</span>
<span class="layui-bg-green">@Model.Description</span>
<span style="color:red;" @Html.Raw(dataValMsg)></span>
<input type="hidden" name="@{@ctlID}" id="@{@ctlID}" value="@Model.FieldValue" @Html.Raw(dataVal) />
<script type="text/javascript">
	jQuery(function () {
		InitCategory("@Model.FieldValue","@Model.Settings[0]","@ctlID");
	});
</script>